package com.ExaminStudy;

import java.util.Scanner;

class Solution {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        String s1=sc.nextLine();
        String s2=sc.nextLine();
        String s3=sc.nextLine();
        String[]strings={s1,s2,s3};

    }
        public String longestCommonPrefix (String[]strs){

            if (strs.length == 0) {
                return "";
            }
            String fin_str = strs[0];

            for (int i = 1; i < strs.length; i++) {
                int j = 0;
                for (j = 0; j < fin_str.length() && j < strs[i].length(); j++) {
                    if (fin_str.charAt(j) != strs[i].charAt(j)) {
                        break;
                    }
                }
                fin_str = fin_str.substring(0, j);

            }
            return fin_str;
        }
    }


